<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<script src="js/informationPage.js"></script>

<script type="text/javascript">
	$(function(){
		$("#exercisecheckAll").click(function(){
			$(".exercisecheck").prop('checked', $(this).is(":checked"));
		});
		
	});


</script>

<script>	
$( "#divAdminExerciseDialogFile" ).dialog({
    autoOpen: false,
    height: 330,
    width: 450,
    modal: true,
    buttons: {
      "닫기": function() {
        $( this ).dialog( "close" );
      }
    },
    close: function() {
  
    }
  });
</script>

<!-- 
    모든 음식 정보 페이지
 -->
    <div id="adminMode" class="exerciseSearch">
		<div id="exerciseSearchbar">
			<h3>전체 운동 관리</h3>
			<form name="exerciseAllSearch">
				<table style="border: 1px solid gray; width:800px; height:60px;">
					<tr>
						<td style="vertical-align: middle;">
							운동명 : 
				            <input type="text" name="exerciseSearch" size="50"/>
				            <input type="submit" value="검색"/>
				       </td>
	            	</tr>
	            </table>
	        </form>
        </div>
        
        <div style="padding: 15px 0px"></div>
        <div id="divAdminExerciseDialogFile" title="운동 사진 파일 업로드">
			<iframe id="exerciseFrame" src="" width="400" height="200" style="border:0;">
			</iframe>
			
		</div>
		
        <form id="adminexerciseList" name="adminexerciseList" method="post">
        <div id="exerciseAllList">
        	전체 운동 : 
        	<table style="border: 1px solid gray; width: 800px; text-align: center">
				<tr style="background: skyblue; height: 30px;">
					<td style="width: 10px"><input type="checkbox" id="exercisecheckAll"></td>
					<td style="width: 60px">운동번호</td>
					<td style="width: 250px">운동명</td>
					<td style="width: 100px">운동목적</td>
					<td style="width: 100px">운동부위</td>
					<td style="width: 70px">삭제여부</td>
					<td style="width: 140px">수정일</td>
					<td style="width: 70px"></td>
            	</tr>
            	<c:forEach var="exercise" items="${exercise }">
            	<tr style="height: 30px;">
            		<td><input type="checkbox" id="exercisecheck" name="exercisecheck" class="exercisecheck" value="${exercise.exerciseNo }"></td>
            		<td>${exercise.exerciseNo }</td>
					<td>${exercise.exerciseName }</td>
					<td>${exercise.exercisePurpose }</td>
					<td>${exercise.exerciseRegio }</td>
					<td>${exercise.exerciseRemoveYn }</td>
					<td><fmt:formatDate value="${exercise.updateDate }" type="date" dateStyle="long"/></td>
					<td>					
						<a href="javascript:adminExercisePreModify(${exercise.exerciseNo });"><input type="button" value="수정하기">
						</a>				
					</td>
            	</tr>
            	</c:forEach>
            	
            	<tr>
					<td><input type="checkbox" class="exercisecheck"></td>
					<td colspan="7" align="left">
						선택음식을 
						<input type="button" value="삭제하기" onclick="javascript:adminExerciseRemove();">
						<input type="button" value="삭제취소" onclick="jacascript:adminExerciseRemoveCancel();">
						<input type="button" value="사진추가" onclick="jacascript:adminExercisePicture();">
					</td>
            	</tr>
            	
	        </table>
	        <div id="pageing" style="margin: 2px 0px 0px 314px;">	        
		       	${page }
	        </div>
        </div>
        </form>
        
</div>